package com.smh.a02exerciseDemo1;

import java.io.*;

public class Test3 {
    public static void main(String[] args) throws IOException {

        //IO流随用随创建,用完记得关闭
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("day27-code\\file\\e.txt"));

        char b = (char) bis.read();
        System.out.println(b);

        int count = Integer.parseInt(String.valueOf(b));
        if (count < 4) {
            System.out.println("欢迎使用本软件,第" + count + "次使用免费");
        } else {
            System.out.println("本软件只能免费使用三次,欢迎您注册会员后继续使用");
        }

        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("day27-code\\file\\e.txt"));
        bos.write(b + 1);

        bos.close();
        bis.close();


    }
}
